home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / vim_doc.zip / DIFFEREN.DOC < prev    next >
Text File  |  1993-01-12  |  13KB  |  336 lines

  1. This is a summary of the differences between VIM and vi.
  2.  
  3.  
  4. The most interesting additions:
  5.  
  6. Multi level undo.
  7. 'u' goes backward in time, 'ctrl-R' goes forward again. Set option 
  8. 'undolines' to the number of changes to be remembered (default 100). Set 
  9. 'undolines' to 0 for old-style undo.
  10.  
  11.  
  12. Repeat a series of commands.
  13. 'v'<c> starts recording typed characters into named buffer <c> (append to the 
  14. buffer if buffer name is upper case). A subsequent 'v' stops recording. The 
  15. buffer can then be executed with the '@'<c> command. This is very useful to 
  16. repeat a complex action.
  17.  
  18.  
  19. Flexible insert mode.
  20. The arrow keys can be used in insert mode to move around in the file. This 
  21. breaks the insert in two parts as far as undo and redo is concerned.
  22.  
  23. CTRL-O can be used to execute a single command-mode command. This is almost 
  24. the same as hitting ESC, typing the command and hitting 'a'. For undo/redo 
  25. only those inserts are remembered where something was actually inserted.
  26.  
  27.  
  28. Quoting.
  29. Quoting can be used to first choose a piece of text and then give a command 
  30. to do something with it. This is an (easy to use) alternative to first giving 
  31. the operator and then moving to the end of the text to be operated upon. 'q' 
  32. and 'Q' are used to start quoting a piece of text. 'q' works on characters 
  33. and 'Q' on lines. Move the cursor to extend the quoted part. It is shown 
  34. highlighted on the screen. By typing 'o' the other end of the quoted text can 
  35. be changed. The quoted text can be affected by an operator:
  36.     d    delete
  37.     c    change
  38.     y    yank
  39.     > or <    insert or delete indent
  40.     ~    swap case
  41.     !    filter through external program
  42.     =    filter through indent
  43.     :    start ":" command for the quoted lines.
  44.     V    format text to 'textwidth' columns
  45.     J    join lines
  46.     u    make uppercase
  47.     U    make lowercase
  48.  
  49.  
  50. Block operators.
  51. With quoting a rectangular block of text can be selected. Start quoting with 
  52. CTRL-Q. The block can be deleted ('d'), yanked ('d') or its case can be 
  53. swapped ('~'). A deleted or yanked block can be put into the text with the 
  54. 'p' and 'P' commands.
  55.  
  56.  
  57. Online help.
  58. ':help' command and help key (F1 for MSDOS) display several pages of concise 
  59. help. The name of the help file can be set with the "helpfile" option.
  60.  
  61.  
  62. Command line editing.
  63. You can insert or delete at any place in the command line using the cursor 
  64. keys. The right/left cursor keys can be used to move forward/backward one 
  65. character. The shifted right/left cursor keys can be used to move 
  66. forward/backward one word.
  67.  
  68. The command lines are remembered. The up/down cursor keys can be used to 
  69. recall previous command lines. The 'history' option can be set to the number 
  70. of lines that will be remembered.
  71.  
  72.  
  73. Filename completion.
  74. While entering a command line (on the bottom line of the screen) <ESC> can be 
  75. typed after an (incomplete) file name wildcard; the wildcard will be 
  76. expanded. If there are multiple matches, CTRL-N (next) and CTRL-P (previous) 
  77. will walk through the matches. CTRL-D can be typed after an (incomplete) file 
  78. name wildcard; all matching files will be listed.
  79.  
  80.  
  81. Text formatting.
  82. The 'textwidth' (tw) option can be used to automatically limit the line 
  83. length. This replaces the 'wrapmargin' option of Vi, which was not very 
  84. useful. The 'V' operator can be used to format a piece of text ("V}" formats 
  85. a paragraph).
  86.  
  87.  
  88. Command line options:
  89.  
  90. When vim is started with "-v" (View) then readonly mode is used (includes 
  91. "-n").
  92.  
  93. When vim is started with "-s scriptfile", the characters read from 
  94. "scriptfile" are treated as if you typed them. If end of file is reached 
  95. before the editor exits, further characters are read from the console.
  96.  
  97. The "-w" option can be used to record all typed characters in a script file. 
  98. This file can then be used to redo the editing, possibly on another file or 
  99. after changing some commands in the script file.
  100.  
  101. The "-n" option disables the writing of a ".vim" file.
  102.  
  103. The "-c command" option does the same as the the "+command" option.
  104.  
  105. The "-T terminal" option sets the terminal type.
  106.  
  107.  
  108. In command mode:
  109.  
  110. Missing commands: 'Q' (go to Ex mode) and 'z' (set window height).
  111. Missing Ex commands: append, change, insert, list, number, open, preserve, 
  112. recover, stop, (un)abbreviate, visual, z and ~.
  113.  
  114. The command characters are shown in the last line of the screen. They are 
  115. removed when the command is finished. If you do not want this (on a slow 
  116. terminal) reset the 'showcmd' option.
  117.  
  118. If the 'ruler' option is set, the current cursor position is shown in the 
  119. last line of the screen.
  120.  
  121. 'u' and CTRL-R accept a count for the number of undos/redos.
  122.  
  123. 'U' still works after having moved off of the last changed line and after u.
  124.  
  125. Nulls in the file are replaced by newlines internally. This allows editing of 
  126. binary files (more or less). When searching for nulls, use a newline in the 
  127. search pattern.
  128.  
  129. Characters with the 8th bit set are displayed. The characters between '~' and 
  130. 0xa0 are displayed as "~?", "~@", "~A", etc., unless the "graphic' option is 
  131. set.
  132.  
  133. '=' is an operator to filter lines through an external command (vi: lisp 
  134. stuff). The name of the command can be set with the 'equalprg' option. The 
  135. default is "indent".
  136.  
  137. '][' goes to the next ending of a C function ('}' in column 1).
  138. '[]' goes to the previous ending of a C function ('}' in column 1).
  139.  
  140. '*' searches forward for the identifier under the cursor, '#' backward.
  141. 'K' runs the program defined by the "keywordprg" option, with the identifier 
  142. under the cursor as argument.
  143.  
  144. '%' can be preceded with a count. The cursor jumps to the line that 
  145. percentage down in the file.
  146.  
  147. With the CTRL-] command, the cursor may be in the middle of the identifier.
  148.  
  149. The used tags are remembered. Commands that can be used with the tag stack 
  150. are CTRL-T, ':pop' and ':tag'. ':tags' lists the tag stack.
  151.  
  152. The 'tags' option can be set to a list of tag file names. Thus multiple 
  153. tag files can be used.
  154.  
  155. Previously used file names are remembered in the alternate file name list.
  156. CTRL-^ accepts a count, which is an index in this list.
  157.  
  158. Search patterns have more features.
  159.  
  160. Searches can find the end of a match and have a character offset.
  161.  
  162. Count added to '~', ':next', ':Next', 'n' and 'N'.
  163.  
  164. Added :wnext command, write current file and edit next one in file list.
  165.  
  166. If option "tildeop" has been set, '~' is an operator (must be followed by a 
  167. movement command).
  168.  
  169. With the 'J' (join) command you can reset the 'joinspaces' (js) option to 
  170. have only one space after a period (Vi inserts two spaces).
  171.  
  172. 'cw' can be used to change white space formed by several characters (Vi is 
  173. confusing: 'cw' only changes one space, while 'dw' deletes all white space).
  174.  
  175. 'o' and 'O' accept a count for repeating the insert (Vi clears a part of 
  176. display).
  177.  
  178. ':dis' command shows the contents of the yank buffers.
  179.  
  180. Previously used file names are remembered in the alternate file name list.
  181. ':files' command shows the list of alternate filenames.
  182. '#'<N> means <N>th alternate filename in the list.
  183.  
  184. Flags after command not supported (no plans to include it).
  185.  
  186. QuickFix commands included, almost the same as with Manx's Z editor.
  187. The 'errorfile' option has the name of the file with error messages.
  188.  
  189. ":cd" command shows current directory instead of going to the home directory.
  190. ":cd ~" goes to home directory.
  191.  
  192. ':source!' command reads Vi commands from a file.
  193.  
  194. ':mkexrc' command writes current modified options and mappings to a file.
  195.  
  196. ':@r' command executes buffer r (is in some versions of vi).
  197.  
  198. CTRL-O/CTRL-I can be used to jump to older/newer positions. These are the 
  199. same positions as used with the '' command, but may be in another file. The 
  200. ':jumps' command lists the older positions.
  201.  
  202. If the 'shiftround' option is set, an indent is rounded to a multiple of 
  203. 'shiftwidth' with '>' and '<' commands.
  204.  
  205. The 'scrolljump' option can be set to the minimal number of lines to scroll 
  206. when the cursor gets off the screen. Use this when scrolling is slow.
  207.  
  208. Uppercase marks can be used to jump between files. The ':marks' command lists 
  209. all currently set marks.
  210.  
  211. The 'shelltype' option can be set to reflect the type of shell used.
  212.  
  213. The CTRL-A (add) and CTRL-S (subtract) commands are new. The count to the 
  214. command (default 1) is added to/subtracted from the number at or after the 
  215. cursor. That number may be decimal, octal (starts with a '0') or hexadecimal 
  216. (starts with '0x').
  217.  
  218. With the :set command the prefix "inv" can be used to invert toggle options.
  219.  
  220.  
  221. In insert mode:
  222.  
  223. The backspace key can be used just like CTRL-D to remove auto-indents.
  224.  
  225. You can backspace, ctrl-U and CTRL-W over newlines if the 'backspace' (bs) 
  226. option is set to non-zero. You can backspace over the start of insert if the 
  227. 'backspace' option is set to 2.
  228.  
  229. If the 'repdel' option is reset, a <BS> in replace mode will not delete a 
  230. character.
  231.  
  232. CTRL-T/CTRL-D always insert/delete an indent in the current line, no matter 
  233. what column the cursor is in. '0' and '^' before CTRL-D are ignored.
  234.  
  235. CTRL-@ (insert previously inserted text) works always (Vi: only when typed as 
  236. first character).
  237.  
  238. CTRL-A works like CTRL-@ but does not leave insert mode.
  239.  
  240. CTRL-B <0-9a-z> can be used to insert the contents of a register.
  241.  
  242. When the 'smartindent' (si) option is set, C programs will be better 
  243. auto-indented.
  244.  
  245. CTRL-R and CTRL-E can be used to copy a character from above/below the 
  246. current cursor position.
  247.  
  248. After CTRL-V you can enter a three digit decimal number. This byte value is 
  249. inserted in the text.
  250.  
  251. When the 'expandtab' (et) option is set, a <TAB> is expanded to the 
  252. appropriate number of spaces.
  253.  
  254. The window always reflects the contents of the buffer (Vi does not do this 
  255. when changing text and in some other cases).
  256.  
  257. If Vim is compiled with DIGRAPHS defined, digraphs are supported. A set of 
  258. normal Amiga digraphs is included. They are shown with the :digraph" command. 
  259. More can be added with ":digraph {char1}{char2} {number}". A digraph is 
  260. entered with {char1} BS {char2}.
  261.  
  262.  
  263. In Ex command line mode and when entering search patterns:
  264.  
  265. CTRL-V only has to be typed once (Vi documentation says: CTRL-V has to be 
  266. typed twice to get one).
  267.  
  268. The named register '.' can be used with commands p, P and :put. The contents 
  269. of the register is the last inserted text.
  270.  
  271. The :put! command inserts the contents of a register above the current line.
  272.  
  273.  
  274. general:
  275.  
  276. Missing options: autoprint (ap), beautify (bf), edcompatible, hardtabs (ht), 
  277. lisp, mesg, open, optimize (op), prompt, redraw, slowopen (slow),
  278. warn, window, w300, w1200 and w9600. Terse option ignored.
  279. timeout option only works for cursor and function keys, not for ordinary 
  280. mapped characters.
  281.  
  282. There is an option for each terminal string. Can be used when termcap is not 
  283. supported or to change individual strings.
  284.  
  285. On systems that have no job control (most systems but BSD-UNIX) the CTRL-Z 
  286. command starts a new shell.
  287.  
  288. If vim is started on the Amiga without an interactive window for output, a 
  289. window is opened (and :sh still works). You can give a device to use for 
  290. editing with the '-d' argument, e.g. "-d con:20/20/600/150".
  291.  
  292. On startup the VIMINIT or EXINIT environment variables, the file s:.vimrc or 
  293. s:.exrc and .vimrc or .exrc are read for initialization commands.
  294.  
  295. Line lenght can be upto 32767 characters (although you cannot see lines 
  296. larger than the screen), file length upto 2147483646 lines.
  297.  
  298. The 'columns' option is used to set or get the width of the display.
  299.  
  300. The version number of vim and the current file name are shown in the title 
  301. bar of the window.
  302.  
  303. Wildcards in file names are expanded.
  304.  
  305. If the "backup" option is set before a file is overwritten, a backup file 
  306. (.bak) is left behind.
  307.  
  308. Option settings are read from the first and last few lines of the file. 
  309. Option 'modelines' determines how many lines are tried (default is 5).
  310.  
  311. If the 'insertmode' option is set (e.g. in .exrc), Vim starts in insert mode.
  312.  
  313. All text is kept in memory. Available memory limits the file size (and other 
  314. things such as undo).
  315.  
  316. All entered commands and text is written into a script file. This can be used 
  317. to recover your work if the machine crashes during an edit session. This can 
  318. be switched off by setting the 'updatecount' option to 0 or starting Vim with 
  319. the "-n" option. Use the 'directory' option for placing the .vim file 
  320. somewhere else.
  321.  
  322. Recovery after a crash has a smaller chance for success, because there is no 
  323. temporary file.
  324.  
  325. Error messages are shown at least one second (Vi overwrites error messages).
  326.  
  327. If Vim asks to "Hit RETURN to continue", you can hit any key. Characters 
  328. other than <CR>, <NL> and <SPACE> are interpreted as the (start of) a 
  329. command. (Vi only accepts an Ex command).
  330.  
  331. The contents of the numbered registers is remembered when changing files.
  332.  
  333. The AUX: device of the Amiga is supported.
  334.  
  335. vi:tw=77:
  336.